package com.fduss.sota.service;

import com.fduss.sota.domain.RiskCheckTemplate;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @Author duocai
 * @Date 2017/6/3
 * @Time 19:48
 */
public interface RiskCheckTemplateService {
    /**
     * add a risk check template
     * @param riskCheckTemplate
     * @return true for success and false for failure
     */
    boolean add(RiskCheckTemplate riskCheckTemplate);

    boolean add(List<RiskCheckTemplate> riskCheckTemplates);

    void delete(RiskCheckTemplate riskCheckTemplate);

    void deleteAll();

    boolean update(RiskCheckTemplate riskCheckTemplate);

    List<RiskCheckTemplate> getAll();

    Page<RiskCheckTemplate> getPage(int pageOffset, int pageSize);

    List<RiskCheckTemplate> getByName(String name);

    /**
     * to get all item that contains the key world in name or description.
     * @param key the key world
     * @return a list of Items. size is 0 if there is no proper items.
     */
    List<RiskCheckTemplate> search(String key);
}
